package com.shujia.duotai_work.exer;

import java.util.Scanner;

/*
工厂设计模式, 解耦的操作
 */
public class PizzaTest {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String mark = sc.next();// 培根 -> 克数, 海鲜 -> 配料
        String size = sc.next();
        double price = sc.nextDouble();

        /*
        逻辑代码没有和具体的子类耦合起来
        Pizza pizza = new BaconPizza(price, size, baconWeight);
        Pizza pizza = new SeaFoodPizza(price, size, baconWeight);
        上面的这行代码出现了很多地方, 不利于代码的维护和扩展
         */
        // Pizza pizza = new BaconPizza(price, size, baconWeight);
        Pizza pizza = PizzaFactory.getPizza(mark, size, price);
        pizza.display();
    }


}
